<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <link rel="stylesheet" href="/lib/layui/css/layui.css" />
    <link rel="stylesheet" href="./css/font-awesome.css" />
    <link rel="stylesheet" href="./css/xadmin.css" />
    <link rel="stylesheet" href="./css/friend.css" />
  </head>
  <body>
    <div class="layui-tab">
      <ul class="layui-tab-title">
        <li class="layui-this" id="li1">文字链接</li>
        <li id="li2">图片链接</li>
      </ul>
      <button type="button" class="layui-btn add">+ 新增</button>

      <div class="layui-tab-content">
        <!-- 文字链接 -->
        <div class="layui-tab-content" id="one">
          <table class="layui-table">
            <thead>
              <tr>
                <th>序号</th>
                <th>标题</th>
                <th>链接描述</th>
                <th>链接类型</th>
                <th>链接地址</th>
                <th>操作</th>
              </tr>
            </thead>
            <tbody class="tbody"></tbody>
          </table>
          <div id="pageone"></div>
        </div>
        <!-- 图片链诶 -->
        <div class="layui-tab-content" id="two" style="display: none">
          <table class="layui-table">
            <thead>
              <tr>
                <th>序号</th>
                <th>链接描述</th>
                <th>链接图片</th>
                <th>链接类型</th>
                <th>链接地址</th>
                <th>操作</th>
              </tr>
            </thead>
            <tbody class="tbody1"></tbody>
          </table>
          <div id="pagetwo"></div>
        </div>
      </div>
    </div>

    <!-- 新增模块 -->
    <script type="text/html" id="addHref">
      <form class="layui-form" action="" id="form1">
        <div class="layui-form-item">
          <label class="layui-form-label">链接类型:</label>
          <div class="layui-input-block">
            <select name="city" lay-verify="required" lay-filter="test1">
              <option value="">请选择类型</option>
              <option value="0">文字链接</option>
              <option value="1">图片链接</option>
            </select>
          </div>
        </div>
        <div class="layui-form-item" style="display: none" id="title1">
          <label class="layui-form-label">标题</label>
          <div class="layui-input-block">
            <input
              type="text"
              name="title"
              required
              lay-verify="required"
              placeholder="请输入标题名称:"
              autocomplete="off"
              class="layui-input"
              id="title5"
            />
          </div>
        </div>
        <div class="layui-form-item">
          <label class="layui-form-label">链接类型:</label>
          <div class="layui-input-block">
            <input
              type="text"
              name="title"
              required
              lay-verify="required"
              placeholder="请输入链接地址名"
              autocomplete="off"
              class="layui-input"
              id="url"
            />
          </div>
        </div>
        <div class="layui-form-item">
          <label class="layui-form-label">链接描述:</label>
          <div class="layui-input-block">
            <textarea
              name="desc"
              placeholder="请输入链接描述名称"
              class="layui-textarea"
            ></textarea>
          </div>
        </div>
      </form>
      <form class="layui-form" action="" id="form2">
        <div class="layui-form-item" style="display: none" id="title2">
          <label class="layui-form-label">链接图片:</label>
          <div class="layui-input-block">
            <input
              type="file"
              name="file"
              id="files"
              style="display: none"
              accept="image/png,image/jpeg,image/gif"
            />
            <button type="button" class="layui-btn" id="submit">
              点击上传
            </button>
          </div>
        </div>
      </form>
    </script>

    <!-- 修改模块 -->
    <script type="text/html" id="renderHtml">
      <form class="layui-form" action="" id="form1">
        <div class="layui-form-item">
          <label class="layui-form-label">链接类型:</label>
          <div class="layui-input-block">
            <select name="city" lay-verify="required" lay-filter="test2">
              <option value="">请选择类型</option>
              <option value="0">文字链接</option>
              <option value="1">图片链接</option>
            </select>
          </div>
        </div>
        <div class="layui-form-item" style="display: none" id="title3">
          <label class="layui-form-label">标题</label>
          <div class="layui-input-block">
            <input
              type="text"
              name="title"
              required
              lay-verify="required"
              placeholder="请输入标题名称:"
              autocomplete="off"
              class="layui-input"
              id="title1"
            />
          </div>
        </div>
        <div class="layui-form-item">
          <label class="layui-form-label">链接类型:</label>
          <div class="layui-input-block">
            <input
              type="text"
              name="title"
              required
              lay-verify="required"
              placeholder="请输入链接地址名"
              autocomplete="off"
              class="layui-input"
              id="url"
            />
          </div>
        </div>
        <div class="layui-form-item">
          <label class="layui-form-label">链接描述:</label>
          <div class="layui-input-block">
            <textarea
              name="desc"
              placeholder="请输入链接描述名称"
              class="layui-textarea"
            ></textarea>
          </div>
        </div>
      </form>
      <form class="layui-form" action="" id="form2">
        <div class="layui-form-item" style="display: none" id="title4">
          <label class="layui-form-label">链接图片:</label>
          <div class="layui-input-block">
            <input
              type="file"
              name="file"
              id="files"
              style="display: none"
              accept="image/png,image/jpeg,image/gif"
            />
            <button type="button" class="layui-btn" id="submit">
              点击上传
            </button>
          </div>
        </div>
      </form>
    </script>

    <script src="/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="./js/xadmin.js"></script>
    <script src="./lib/layui/layui.all.js"></script>
    <script src="./js/axios.js"></script>
    <script src="./js/baseApi.js"></script>
    <script src="./js/jquery.min.js"></script>
    <!-- 自己的js -->
    <script src="./js/friend.js"></script>
  </body>
</html>
